{include file="public/header"}
<div class="page-content">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf" style=" height: 600px;">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">美食列表</div>
            </div>
            <div class="widget-body am-fr">
                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                    <div class="am-form-group">
                    </div>
                </div>
                <div class="am-u-sm-12">
                    <table class="am-table am-table-compact am-table-striped tpl-table-black"id="dyntable">
                    <thead>
                        <tr>
                            <th class="head0 nosort"><input type="checkbox" class="checkall" /></th>

                            <th class="center">编号</th>
                            <th class="center">名称</th>
                            <th class="center">图片</th>
                            <th class="center">价格</th>
                            <th class="center">上架时间</th>
                            <th class="center">状态</th>
                            <th class="center">操作</th>

                        </tr>
                    </thead>
                    <tbody>
                        {volist name="data" id="vo"}
                            <tr class="gradeX">
                                <td class="aligncenter">
                                    <span class="center">
                                        <input type="checkbox" />
                                    </span>
                                </td>
                                <td class="center">{$vo.id}</td>
                                <td class="center">{$vo.name}</td>
                                <td><img style="width:50px;" src="__ROOT__/uploads/{$vo.pic}" alt=""></td>
                                <td class="center">{$vo.price}</td>
                                <td class="center">{$vo.regtime}</td>
                                <td class="center">{$vo.status}</td>
                                <td class="center">
                                    <a href="{:url('foods/upFoods',['no'=>$vo.id])}">
                                        <i class="am-icon-pencil"></i>编辑
                                    </a>
                                    <a onclick="showDel('{$vo.id}','{$vo.name}')"
                                       class="item-delete tpl-table-black-operation-del">
                                        <i class="am-icon-trash"></i> 删除
                                    </a>
                                </td>
                            </tr>
                        {/volist}
                    </tbody>
                </table>
                {$data->render()}
            </div>
        </div>
        
    </div>
</div>
    
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
    layui.use(['element','layer'], function(){
        var element = element;});

    function showDel(no,name) {
        var layer = layui.layer;
        layer.confirm('确认删除'+name+'？', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function (index, layero) {
            //按钮【按钮一】的回调
            location.href="{:url('foods/del')}"+"?no="+no;
        }, function (index) {
            //按钮【按钮二】的回调
        });
    }
</script>
</body>
</html>